fn gcd_iter(mut m: i32, mut n: i32) -> i32 {
   while m != 0 {
       let old_m = m;
       m = n % m;
       n = old_m;
   }
   n.abs()
}

fn gcd_rec(m: i32, n: i32) -> i32 {
   if m == 0 {
      n.abs()
   } else {
      gcd_rec(n % m, m)
   }
}

fn main() {
   println!("{}",gcd_iter(399,-3999));
   println!("{}",gcd_rec(0,3999));
}
